#ifndef __RDISTRO_H__
#define __RDISTRO_H__

#include "../../rdx/src/rdx/rdx_basictypes.hpp"


namespace RDistro
{
	using namespace RDX;

	struct PacketHeader
	{
		UInt16 packetSize;
		UInt16 protocolCode;
	};

	enum ProtocolCodes
	{
		SV_ERROR,

		SV_SHUTDOWN_SERVER,
		SV_RESTART_SERVER,
		SV_SELF_UPDATE,
		SV_TIME_CHECK_FILE,
		SV_DOWNLOAD_FILE,
		SV_DOWNLOAD_MORE,
		SV_UPLOAD_FILE,
		SV_UPLOAD_FILE_DATA,
		SV_UPLOAD_FILE_FINISH,
		SV_DESTROY_FILE,
		SV_CREATE_JOB,
		SV_REQUEST_JOB,
		SV_REQUEST_MORE_WORK,
		SV_QUERY_JOB_STATUS,
		SV_DESTROY_JOB,
		SV_KEEPALIVE,

		CL_ERROR,

		CL_SET_AUTH_TOKEN,
		CL_TIME_CHECK_FILE_MATCHES,
		CL_TIME_CHECK_FILE_LOCAL_IS_NEWER,
		CL_TIME_CHECK_FILE_SERVER_IS_NEWER,
		CL_FILE_DOES_NOT_EXIST,
		CL_DOWNLOAD_FILE,
		CL_DOWNLOAD_FILE_DATA,
		CL_DOWNLOAD_FILE_FINISH,
		CL_FILE_DOWNLOAD_INTERRUPTED,
		CL_UPLOAD_FAILED,
		CL_UPLOAD_MORE,
		CL_NO_JOBS,
		CL_WORK_ON_JOB,
		CL_WORK,
		CL_WORK_EXHAUSTED,
		CL_JOB_FINISHED,
		CL_JOB_FINISHING,
		CL_JOB_OUTSTANDING,
		CL_PING,
	};
};


#endif
